package com.rose.datax.dataxadmin.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;

/**
 *  数据迁移任务
 */

@TableName("migration_task")
@Data
public class MigrationTask extends BaseEntity {
    private static final long serialVersionUID = -3936188117109760785L;
    @TableField("task_name")
    private String taskName;

    @TableField("source_id")
    private Long sourceId;

    @TableField("source_db")
    private String sourceDb;

    @TableField(exist = false)
    private String sourceName;

    @TableField("target_id")
    private Long targetId;

    @TableField(exist = false)
    private String targetName;

    @TableField("target_db")
    private String targetDb;

    private String status;

    @TableField("run_time")
    private long runTime;

    @TableField("error_break")
    private boolean errorBreak;

    @TableField("start_time")
    private Date startTime;

    //同步表的数量
    private int tables;

    @Override
    public String toString() {
        return "MigrationTask{" +
                "taskName='" + taskName + '\'' +
                ", sourceId=" + sourceId +
                ", sourceDb='" + sourceDb + '\'' +
                ", targetId=" + targetId +
                ", targetDb='" + targetDb + '\'' +
                '}';
    }
}
